blk=( 84 63 60 45 42 36 35 30 28 21 20 18)
sblk=(15  20 21 28 30 35 36 42 45 60 63 70)

file=temp.log
result_file=result.log
rm $file $result_file

for((i=0;i<12;i++))
do
  sed s/@BLK/${blk[$i]}/g makefile_temp > temp
  sed s/@SBLK/${sblk[$i]}/g temp > makefile_test_$i
  cp -f makefile_test_$i Makefile
  make clean
  make dag

  bsub -I -b -q q_sw_expr -n 1 -cgsp 64 -host_stack 1024 -share_size 6000 -o $file ./sparselu 
done

rm temp

echo total_graph_build >> $result_file
grep -n "total_graph_build" $file | awk {'print $2'} >> $result_file

echo total_graph_exec >> $result_file
grep -n "total_graph_exec" $file | awk {'print $2'} >> $result_file

echo total_time >> $result_file
grep -n "total_time" $file | awk {'print $2'} >> $result_file

echo mutex_file >> $result_file                                                                                                                                                              
grep -n "ain core mutex fa" ./$file | awk '{print $6}' >> $result_file
echo total_mutex >> $result_file
grep -n "re mutex success co" ./$file| awk '{print $6}' >> $result_file

cat $result_file

mv $file $1_$file
mv $result_file $1_${result_file}

